<%@page import="member.MemberVo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Modify.jsp</title>
<style>
#modify_body{

}
form>label{
	display: inline-block; width:100px; text-align: center;
}
</style>
<script>
function getId(id){ return document.getElementById(id);}

function init(){
	getId('btnSubmit').onclick = function(){
		var p1 = frm.newPwd1.value;  // 새로운 비밀번호 부분
		var p2 = frm.newPwd2.value;  // 비밀번호 확인하는 부분
		
		if(p1 == p2){
			frm.action="index2.jsp?inc_center=./jsp/modify_result.jsp";
			frm.submit();
		}else{
			alert("암호가 일치하지 않습니다.");
		}
	}
	
	getId('btnCancel').onclick = function(){
		
	}
}
</script>

</head>
<body>
<jsp:useBean id="bean" class="member.Login" scope="page" />
<jsp:setProperty property="*" name="bean"/>
<%
MemberVo m = bean.view();
%>
<div id="modify_body">
	<h1>회원 수정 정보</h1>
	<form name="frm" method="post" action="">
		<label>아이디</label>
		<input type="text" name="mid" value="<%=m.getMemberid() %>" readonly><br/>
		<label>암&emsp;호</label>
		<input type="text" name="pwd" value="<%=m.getPwd() %>"><br/>
		<br/>
		<label>새로운 암호</label>
		<input type="password" name="newPwd1"><br/>
		<label>확&emsp;&emsp;&emsp;인</label>
		<input type="password" name="newPwd2"><br/>
	
	</form>
	
	<input type="button" value="수정" id="btnSubmit">
	<input type="button" value="취소" id="btnCancel">
</div>
<script>
init();
</script>

</body>
</html>